﻿using System;
using System.Collections.Generic;
using System.Text;
using OpenGado.DATA.Entities;
using OpenGado.DATA;


namespace OpenGado.Business
{
    /// <summary>
    /// Class manages the Business logic of the storage class 
    /// </summary>
   public  class StorageBusiness
    {
       /// <summary>
       /// Proxies save request to the data layer
       /// </summary>
       /// <param name="storage"></param>
       public void Save(Storage storage)
       {
           StorageDataControl.Instance.Save(storage);
       }

        /// <summary>
        /// Saves the product information to the store (Storage has product table)
        /// </summary>
        /// <param name="storage"></param>
        /// <param name="product"></param>
        /// <param name="quantity"></param>
        /// <param name="unitOfMeasure"></param>
       // public void Save(Storage storage, Product product, decimal quantity, UnitOfMeasure unitOfMeasure)
       //{

       //  StorageDataControl.Instance.Save(storage, product, quantity, unitOfMeasure);

       //}


       /// <summary>
       /// Deletes the store
       /// </summary>
       /// <param name="storage"></param>
        public  void Delete (Storage storage)
       {
           StorageDataControl.Instance.Delete(storage);
       }

       /// <summary>
       /// Deletes the product from the store
       /// </summary>
       /// <param name="storage"></param>
       /// <param name="product"></param>
       public void Delete (Storage storage, Product product)
       {
           // find the store and product in store has product then delete that instance

           StorageHasProduct sp = new StorageHasProduct();
           
       

       }
       /// <summary>
       /// Will move Product from one store to another
       /// </summary>
       /// <param name="storage"></param>
       /// <param name="product"></param>
       /// <param name="quantity"></param>
       public void MoveProduct(Storage storage, Product product, Decimal quantity)
       {



       }

        public IList<Storage> GetAllStores()
       {
          return  StorageDataControl.Instance.GetAllStores();
       }

       public  Storage GetStoreById(int storeId)
       {
           return StorageDataControl.Instance.GetStoreById(storeId);
       }
    }
}
